home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17279 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: news.accent.net!news
  2. From: dallaire@megatoon.com (Guy Dallaire)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Josephus Problem
  5. Date: Mon, 15 Apr 1996 01:43:50 GMT
  6. Organization: Accent Internet
  7. Message-ID: <4ks9re$k47@news.accent.net>
  8. References: <1996Apr11.165209@topaz>
  9. NNTP-Posting-Host: 198.53.28.208
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. naderr@topaz.cqu.edu.au wrote:
  13.  
  14. >Hi,
  15.  
  16.  
  17. > Brief Description of Josephus Problem:
  18.  
  19. > The program reads two positive integers, n and q.
  20. > Suppose n persons form a circle.  In clockwise order, we assign
  21. > numbers 1,2,...,n to them.  Starting at person 1 and counting clockwise
  22. > we remove the q-th person from the circles.  In the reduced circle,
  23. > we continue with the person following the person just removed and,
  24. > resume counting from 1 to q, again eliminating the q-th person.
  25. > This process is repeated until only one person remains: the program
  26. > outputs the number n, of this person.
  27.  
  28. So WHAT ?
  29. Guy Dallaire
  30. Groupe DMR Inc.
  31. dallaire@megatoon.com
  32.  
  33. P.S. My opinions are my own and do not reflect those of my employer
  34.  
  35.